<template>
  <div>
    子组件1
    <button @click="num++">{{ num }}</button>
  </div>
</template>

<script setup>
import { ref,onUnmounted,onActivated,onDeactivated } from 'vue';

const num = ref(1)

onUnmounted(()=>{
  console.log("1 onUnmounted....");
})

onActivated(()=>{
  console.log('1 onActivated......');
})
onDeactivated(()=>{
  console.log('1 onDeactivated....');
})
</script>